<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">
    <h2>{{message}}</h2>
    <span v-if="isUser">
        <label for="username">用户账号</label>
        <!-- key相关：https://cn.vuejs.org/v2/guide/conditional.html -->
        <input type="text" id="username" placeholder="请输入账号" key="username-input">
    </span>
    <span v-else>
        <label for="email">用户邮箱</label>
        <input type="text" id="email" placeholder="请输入邮箱" key="email-input">
    </span>
    <button @click="isUser = !isUser">切换类型</button>
</div>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script>
    const app = new Vue({
        el: '#app',
        data: {
            message: 'simplelu',
            isUser: true
        }
    })
</script>
</body>
</html>